﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MenuApplication
{
    public partial class FormIndialog : Form
    {
        private IntegerData id = new IntegerData();

        public IntegerData Id
        {
            get { return id; }
            set { id = value; }
        }
        
        public FormIndialog()
        {
            InitializeComponent();
        }
        private void FormIndialog_Load(object sender, EventArgs e)
        {

        }

        private void OkButton_Click(object sender, EventArgs e)
        {
            Id.Data = Convert.ToInt32(textBoxInput.Text);
            Id.Init = true;
            DialogResult = DialogResult.OK;
            Close();
        }

        private void CancelButton_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Really cancel input?","Cancel input", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                DialogResult = DialogResult.Cancel;
                Close();
            }
        }
    }
}
